package annotation;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.stereotype.Component;


public class App {
 public static void a(){
     //加载扫描
   ApplicationContext context = new AnnotationConfigApplicationContext("annotation");
     DemoA a = context.getBean("demoA", DemoA.class);
     a.a();
 }
 public static void b(){
     ApplicationContext context = new AnnotationConfigApplicationContext("annotation");
     DemoB b = context.getBean("db", DemoB.class);
     System.out.println(b);
 }
 public static void c(){
     ApplicationContext context = new AnnotationConfigApplicationContext("annotation");
     DemoC b = context.getBean("dc", DemoC.class);
     System.out.println(b);
 }
 public static void d(){
     ApplicationContext context = new AnnotationConfigApplicationContext("annotation");
     DemoD b = context.getBean("demoD", DemoD.class);
     System.out.println(b);
 }
 public static void e(){
     ApplicationContext context = new AnnotationConfigApplicationContext("annotation");
     DemoF f = context.getBean( DemoF.class);
     f.f();
 }

    public static void main(String[] args) {
        e();
    }
}
